import request from '@/utils/request';

export type LoginParamsType = {
  username: string;
  password: string;
  mobile: string;
  captcha: string;
  type: string;
  tenant: string;
  veriCode: string;
  telphone: string;
  name: string;
  tenancyName: string;
};

export async function fakeAccountLogin(params: LoginParamsType) {
  return request('/api/login/account', {
    method: 'POST',
    data: params,
  });
}

export async function getFakeCaptcha(mobile: string) {
  return request(`/api/login/captcha?mobile=${mobile}`);
}

export async function outLogin() {
  return request('/api/TokenAuth/UnAuthenticate', {
    method: 'POST',
  });
}

export async function abpLogin(params: any) {
  return request('/api/TokenAuth/Authenticate', {
    method: 'POST',
    data: params,
  });
}
export async function abpIsTenantAvailable(params: any) {
  return request('/api/services/app/Account/IsTenantAvailable', {
    method: 'POST',
    data: params,
  });
}
export async function getUser(params: any) {
  return request('/api/services/app/User/Get', {
    method: 'GET',
    params,
  });
}
